package com.campus.client.controller;


import com.campus.client.net.ClientConnector;
import com.campus.common.message.StudentChangeInfoResponse;


import javax.swing.*;
import java.io.IOException;
import java.util.List;

public class StudentInfoController {
    private ClientConnector connector;

    public StudentInfoController(ClientConnector connector) {
        this.connector = connector;
    }

    public boolean sendRequest(String studentId,String contactInfo,String oldContactInfo) throws ClassNotFoundException, IOException {
        StudentChangeInfoResponse resp = connector.addRequest(studentId,contactInfo,oldContactInfo);
        return resp.isSuccess();
    }

    // 可选：结束会话时关闭连接
    public void closeConnection() throws IOException {
        connector.close();
    }
}
